<?php

/**
 * member form base class.
 *
 * @method member getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasememberForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ID'                 => new sfWidgetFormInputHidden(),
      'ClassName'          => new sfWidgetFormChoice(array('choices' => array('Member' => 'Member'))),
      'Created'            => new sfWidgetFormDateTime(),
      'LastEdited'         => new sfWidgetFormDateTime(),
      'FirstName'          => new sfWidgetFormInputText(),
      'Surname'            => new sfWidgetFormInputText(),
      'Email'              => new sfWidgetFormInputText(),
      'Password'           => new sfWidgetFormInputText(),
      'RememberLoginToken' => new sfWidgetFormInputText(),
      'NumVisit'           => new sfWidgetFormInputText(),
      'LastVisited'        => new sfWidgetFormDateTime(),
      'Bounced'            => new sfWidgetFormInputText(),
      'AutoLoginHash'      => new sfWidgetFormInputText(),
      'AutoLoginExpired'   => new sfWidgetFormDateTime(),
      'PasswordEncryption' => new sfWidgetFormInputText(),
      'Salt'               => new sfWidgetFormInputText(),
      'PasswordExpiry'     => new sfWidgetFormDate(),
      'LockedOutUntil'     => new sfWidgetFormDateTime(),
      'Locale'             => new sfWidgetFormInputText(),
      'FailedLoginCount'   => new sfWidgetFormInputText(),
      'DateFormat'         => new sfWidgetFormInputText(),
      'TimeFormat'         => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'ID'                 => new sfValidatorChoice(array('choices' => array($this->getObject()->get('ID')), 'empty_value' => $this->getObject()->get('ID'), 'required' => false)),
      'ClassName'          => new sfValidatorChoice(array('choices' => array(0 => 'Member'), 'required' => false)),
      'Created'            => new sfValidatorDateTime(array('required' => false)),
      'LastEdited'         => new sfValidatorDateTime(array('required' => false)),
      'FirstName'          => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'Surname'            => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'Email'              => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'Password'           => new sfValidatorString(array('max_length' => 160, 'required' => false)),
      'RememberLoginToken' => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'NumVisit'           => new sfValidatorInteger(array('required' => false)),
      'LastVisited'        => new sfValidatorDateTime(array('required' => false)),
      'Bounced'            => new sfValidatorInteger(array('required' => false)),
      'AutoLoginHash'      => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'AutoLoginExpired'   => new sfValidatorDateTime(array('required' => false)),
      'PasswordEncryption' => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'Salt'               => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'PasswordExpiry'     => new sfValidatorDate(array('required' => false)),
      'LockedOutUntil'     => new sfValidatorDateTime(array('required' => false)),
      'Locale'             => new sfValidatorString(array('max_length' => 6, 'required' => false)),
      'FailedLoginCount'   => new sfValidatorInteger(array('required' => false)),
      'DateFormat'         => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'TimeFormat'         => new sfValidatorString(array('max_length' => 30, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('member[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'member';
  }

}
